package cn.shyouchi.wuguanjia.android.ui.event.labor;

import com.chad.library.adapter.base.entity.MultiItemEntity;

import cn.shyouchi.wuguanjia.android.chart.YValue;

/**
 * Created by Eenie on 2016/11/3 at 9:41
 * Email: 472279981@qq.com
 * Des:个人每一行的班次
 */

public class PersonLaborEntity implements MultiItemEntity {

    private int id;   //班次ID
    private String name; //班次名
    private String startTime;//班次的开始时间
    private String endTime;//班次的结束时间
    private double interval;//班次的工作时间
    private int count;//班次的个数


    private Object tag;


    public PersonLaborEntity(YValue yValue) {
        this.id = yValue.getId();
        this.name = yValue.getName();
        this.startTime = yValue.getStartTime();
        this.endTime = yValue.getEndTime();
        this.interval = yValue.getInterval();
        this.count = 0;
    }




    @Override
    public int getItemType() {
        return PersonLaborAdapter.ITEM_EVENT_PERSON_RANK;
    }


    public int getCount() {
        return count;
    }

    public void addCount() {
        if (count < 31) {
            count++;
        }
    }

    public void subCount() {
        if (count > 0) {
            count--;
        }
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public double getInterval() {
        return interval;
    }

    public void setInterval(double interval) {
        this.interval = interval;
    }

    public void setCount(int count) {
        this.count = count;
    }


    public Object getTag() {
        return tag;
    }

    public void setTag(Object tag) {
        this.tag = tag;
    }
}
